p; cin.ignore(1000, 10); double annualInterestRate; cout > annualInterestRate; cin.ignore(1000, 10); double r = annualInterestRate/1200; double yearsForPayback = 30; double n = yearsForPayback * 12; double monthlyPayment = (p * pow(1+(r),n) * r)/((pow(1+r,n))" />
Beginner in Programming C++ :
Limit the user to 3 incorrect password entries. Exit the
program if the correct password is not entered after 3 tries. the
function will ha…
Beginner in Programming C++ : Limit the user to 3 incorrect password entries. Exit the program if the correct password is not entered after 3 tries. the function will have to tell main that either a valid password got entered in 3 tries, or not. (ONLY VOID AND VALUE RETURNING FUNCTION) Input: a password from the console keyboard, and then two mortgage calculation inputs. Output: An "invalid" message for each incorrect password entry, then the mortgage calculation output, unless 3 invalid passwords were entered #include #include using namespace std; #include void getPassword(); int main() { getPassword(); cout< int p; cout > p; cin.ignore(1000, 10); double annualInterestRate; cout > annualInterestRate; cin.ignore(1000, 10); double r = annualInterestRate/1200; double yearsForPayback = 30; double n = yearsForPayback * 12; double monthlyPayment = (p * pow(1+(r),n) * r)/((pow(1+r,n))-1); //echo input values of amount borrowed, annual interest rate, payback period, and monthly payment cout |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |